package com.fastword.demo.request;

import com.clientAda4j.ClientAdaClaimExecutor;
import com.clientAda4j.anno.ClientAdaComponent;
import com.clientAda4j.anno.ClientAdaInterface;
import com.clientAda4j.component.ClientAdaEnvironment;
import com.clientAda4j.domain.ClientAdaCoreProp;
import com.clientAda4j.domain.ClientResponseProp;
import com.fastword.demo.domain.DefaultWeatherClientResponseProp;
import com.fastword.demo.component.WeatherClientHeaderAdapter;
import org.springframework.beans.factory.annotation.Autowired;

@ClientAdaComponent(clientName = "实时天气", clientHeaderAdapter = WeatherClientHeaderAdapter.class)
public class WeatherService {

    @Autowired
    private ClientAdaClaimExecutor claimExecutor;

    @ClientAdaInterface(interfaceName = "实时天气V1", interfaceUri = "")
    public ClientResponseProp<DefaultWeatherClientResponseProp> baseinfo(Object map) {
        ClientResponseProp<DefaultWeatherClientResponseProp> execute =
                claimExecutor.executeResponseCls(map, DefaultWeatherClientResponseProp.class, new ClientAdaEnvironment() {
                    @Override
                    public void env(ClientAdaCoreProp envProp) {
                        System.out.println("============================>>>>>>" + envProp);
                    }
                });
        System.out.println(execute);
        return execute;
    }
}

